@svizzle/utils/[any-boolean]-[array-array]

Methods

(static) raiseWith() → {function}

Source:
Since:
  • 0.11.0

Return a function expecting an array and returning a new array with all items satisfying the provided predicate in the tail, in the same relative order they were in the input array.

Example
> raiseOdds = raiseWith(x => x % 2 === 1);
> raiseOdds([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
[0, 2, 4, 6, 8, 1, 3, 5, 7, 9]
Parameters:
Type Description
predicate
Returns:
  • Array -> Array
Type
function